
<?php

$img = glob('public/upload/ambientes/'.$this->ambiente['AMB_ID'].'.*');
@$img = $img[0];

?>

<div id="ctn_ambiente" style="background-image: url('<?php echo $this->urlbase.'/'.$img; ?>'); ?>">
    <div class="til_flt"><?php echo $this->ambiente['AMB_NOM']; ?></div>

    <div class="txt_flt">
        <div class="ctn_sld">
            <div class="t_f_til">DESCRIÇÃO:</div>
            <div class="t_f_txt"><?php echo $this->ambiente['AMB_TXT']; ?></div>
        </div>
        <div class="t_f_btn"><span class="icn_seta_r"></span></div>
    </div>
    
    <div class="txt_cor_text">
        <div class="t_c_t_btn">
            <span class="icn_seta_l"></span>
            
            <div class="t_c_t_b_til">Cores<br>e Tex<br>Turas</div>
        
        </div>
        <div class="t_c_t_b_cet">
            <div class="t_c_t_b_cnt">
                <div class="t_c_t_b_til">
                    CORES E TEXTURAS DISPONÍVEIS
                </div>
                <ul class="t_c_t_b_cores">
                <?php
                    if(is_array($this->cores))
                    foreach($this->cores as $cor){
                        $imgs = glob('public/upload/cores/'.$cor['COR_ID'].'.*');
                        $img = '';
                        if($imgs[0]) $img = '<img src="'.$this->urlbase.'/'.$imgs[0].'" />';
                ?>
                    <li>
                        <input type="checkbox" class="lcores" value="<?php echo $cor['COR_ID']; ?>">
                        <?php echo $img; ?>
                    </li>
                <?php } ?>
                </ul>
                
                <?php if(count($this->acabamentos) > 0){ ?>
                <div class="t_c_t_b_til">
                    ACABAMENTOS DISPONÍVEIS
                </div>
                <ul class="t_c_t_b_aca">
                <?php
                    if(is_array($this->acabamentos))
                    foreach($this->acabamentos as $aca){
                        $imgs = glob('public/upload/acabamentos/'.$aca['ACA_ID'].'.*');
                        $img = '';
                        if($imgs[0]) $img = '<img src="'.$this->urlbase.'/'.$imgs[0].'" />';
                ?>
                    <li>
                        <input type="radio" class="lacab" name="nacab" value="<?php echo $aca['ACA_ID']; ?>">
                        <?php echo $img; ?>
                    </li>
                <?php } ?>
                </ul>
                <?php } ?>
                <div class="t_c_t_b_orc">
                    <button type="button" id="btn_orc">Solicitar Orçamento</button>
                </div>
                
            </div>
        </div>
    </div>
    
    <button type="button" class="btn_vlt" onclick="window.location.href='<?php echo $this->urlbase.'/'; ?>'">voltar</button>
    
    <div class="c_a_prt">
        <div class="c_a_p_c">
            <div class="c_a_p_til">PRO<br/>JETOS</div>
            
            
            <div class="slider-prj">
                <?php

                $query = 'SELECT SQL_CACHE * FROM PROJETOS WHERE PRT_STA = 1 AND AMB_ID = '.$this->ambiente['AMB_ID'];
                $result = $this->db->fetchAll($query);
                ?>
                <ul>
                    <?php foreach($result as $row) { 
                        $img = glob('public/upload/projetos/'.$row['PRT_ID'].'_m_*.*');

                        if(isset($img[0])) { 
                    ?>
                    <li id="<?php echo $row['PRT_ID']; ?>" class="gf_clk">
                        <img src="<?php echo $this->urlbase.'/'.$img[0];?>"  />
                        <div class="img-dsc">
                            <div class="i_d_txt"><?php echo $row['PRT_NOM']; ?></div>
                        </div>
                    </li>
                    <?php } }  ?>
                </ul>
            </div>
            <?php // auto: 4, scroll: 1, wrap: 'circular'  ?>
            <script src="<?php echo $this->urlbase;?>/public/media/js/jquery.jcarousel.min.js" type="text/javascript"></script>
            <script>
            $(document).ready(function() {  
                $('.slider-prj').jcarousel({ scroll: 1  }); 
            });
            </script>
             
        </div>
    </div>
    
   <div class="galeriafull">
       <img src="<?php echo $this->urlbase;?>/public/media/images/loader.gif" class="loader" />
       <span class="g_fechar"></span>
       <span class="g_seta_l"></span>
       <span class="g_seta_r"></span>
       <div class="g_f_img_alt"></div>
    <?php foreach($result as $row) { ?>  
       <div id="galeria<?php echo $row['PRT_ID']; ?>" class="galeriaitg" itemid="<?php echo $row['PRT_ID']; ?>">
        <?php
            
            $where = '  GAL_MOD LIKE "projetos"';
            $where .= ' AND GAL_MODNUM = '.$row['PRT_ID'];
            $query = 'SELECT SQL_CACHE GAL_DSC,GAL_IDIMG FROM GALERIA WHERE '.$where.' ORDER BY GAL_ORD ASC';
            $imgs = $this->db->fetchAll($query);
        
            foreach($imgs as $key => $row) {
                $alt = $row['GAL_DSC'];
                $imgs = glob('public/upload/projetos/'.$row['GAL_IDIMG']);
                $img = str_replace('_tb','',$imgs[0]);                
            ?>
                <div id="<?php echo $key; ?>" class="g_f_img" alt="<?php echo $alt; ?>" style="background-image: url('<?php echo $this->urlbase.'/'.$img; ?>');<?php echo $style; ?>"></div>
            <?php   
            } 
        ?>  
        </div>
    <?php        
        }  
    ?>
   </div>
    
</div>

<a class="fc_popup" href="#popup"></a>
<div id="popup" class="ctn-popup" style="display: none;">
    <div class="titulo"><span class="lnh_bar"></span>Solicitação de Orçamento<span class="lnh_bar"></span></div>
    <form id="form" class="form_popup">
        <input type="hidden" id="cores" name="cores" value=""/>
        <input type="hidden" id="acab" name="acabamentos" value=""/>
        
        <input type="text" id="nome" name="nome" placeholder="nome" required="" />
        <input type="text" id="email" name="email" placeholder="e-mail" required="" class="email"/>
        <input type="text" id="telefone" name="telefone" placeholder="telefone" required="" class="telefone" />
        <textarea id="mensagem" name="mensagem" placeholder="mensagem"></textarea>
        <button type="submit" id="enviar" name="enviar">enviar</button>
   
     </form>
</div>
